home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1533 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  884 b 

  1. Path: info.uah.edu!oreo!gbacon
  2. From: gbacon@oreo (Greg Bacon)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: atol or strtol ?
  5. Date: 14 Jan 1996 22:50:53 GMT
  6. Organization: The University of Alabama in Huntsville
  7. Message-ID: <4dc1cd$9ug@info.uah.edu>
  8. References: <4dbobq$763@jupiter.planet.net>
  9. NNTP-Posting-Host: oreo.aspire.cs.uah.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Chris Kemp (chrisk@paladn.com) wrote:
  13. : what is the difference between  strtol function and atol ?
  14.  
  15. atol() takes a string representing a number which it assumes to be
  16. expressed in base-10 and returns the equivalent long.  Dig page
  17. 251 of K&R II:
  18.  
  19. "long atol(const char *s)
  20.     converts s to long; it is equivalent to
  21.     strtol(s, (char **) NULL, 10)."
  22.  
  23. Check your compiler's docs for further info on strtol().
  24.  
  25. Greg
  26. --
  27. Greg Bacon <gbacon@cs.uah.edu>
  28. University of Alabama in Huntsville
  29. CS Department Systems Support Team
  30.